package com.heima.behavior.controller.v1;

import com.baomidou.mybatisplus.extension.api.R;
import com.heima.behavior.service.ApLikesBehaviorService;
import com.heima.model.article.dtos.CollectionBehaviorDto;
import com.heima.model.behavior.dtos.LikesBehaviorDto;
import com.heima.model.behavior.dtos.ReadBehaviorDto;
import com.heima.model.behavior.dtos.UnLikesBehaviorDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1")
public class ApLikesBehaviorController {

    @Autowired
    private ApLikesBehaviorService apLikesBehaviorService;
    //文章点赞/取消点赞
    @PostMapping("/likes_behavior")
    public ResponseResult like(@RequestBody LikesBehaviorDto dto) {
        return apLikesBehaviorService.like(dto);
    }
    //阅读
    @PostMapping("/read_behavior")
    public ResponseResult read(@RequestBody ReadBehaviorDto dot ){
        return apLikesBehaviorService.read(dot);
    }
    //文章不喜欢/取消不喜欢
    @PostMapping("/un_likes_behavior")
    public ResponseResult unLikes(@RequestBody UnLikesBehaviorDto dto){
        return apLikesBehaviorService.unLikes(dto);
    }

}
